package cn.edu.ldu.views.main.util;

import lombok.Data;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

public class ListModel<E> extends DefaultListModel<E> {

    private List<Long> userIds;
    private List<Integer> types;

    /**
     * 关于type
     * 0 表示朋友 1 表示群聊
     */

    public ListModel(){
        super();
        userIds = new ArrayList<>();
        types = new ArrayList<>();
    }

    public void addElement(E element, Long userId,int type) {
        addElement(element);
        userIds.add(userId);
        types.add(type);
    }

    public Long getUserIds(int i) {
        return userIds.get(i);
    }

    public void setUserIds(List<Long> userIds) {
        this.userIds = userIds;
    }

    public Integer getType(int i) {
        return types.get(i);
    }

    public void setType(List<Integer> type) {
        this.types = type;
    }
}
